﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace whereIsTheDonutGame
{

    class Donut
    {
        public bool recieved { get; set; }
        public Model Model { get; set; }
        public Vector3 Position { get; set; }

        public BoundingSphere boundingSphere { get; set; }

        public Donut()
        {
            recieved = false;
            Model = null;
            boundingSphere = new BoundingSphere();
        }
        public void LoadContent(ContentManager content)
        {
            Model = content.Load<Model>("donut");
            Position = Vector3.Down;
        }

        public void UpdateBoundingSphere()
        {
            boundingSphere = new BoundingSphere();

            foreach (ModelMesh mesh in Model.Meshes)
            {
                    boundingSphere = BoundingSphere.CreateMerged(boundingSphere, mesh.BoundingSphere);
            }

            boundingSphere.Transform(Matrix.CreateTranslation(Position));

          
        }
    }
}
